#include "tile.h"
#include "graphicsmanager.h"

static bool TexInit = false;
Texture* Tile::Grass = nullptr;
Texture* Tile::Water = nullptr;

Tile::Tile() : TileType(TileTypes::Grass)
{
	if (!TexInit){
		Grass = new Texture("grass.png");
		Water = new Texture("water.png");
		TexInit = true;
	}
	//ctor
}

Tile::~Tile()
{
	//dtor
}

void Tile::Draw(float x, float y, float width, float height){
	Texture *tex = Grass;
	if (TileType == TileTypes::Grass){
		tex = Grass;
	} else if (TileType == TileTypes::River){
		tex = Water;
	} else if (TileType == TileTypes::Mountain){
		//TileColor = Color(1, 0.5, 0.5);
	}
	tex->Draw(x * width, y * height, width, height);
	//GraphicsManager::DrawRectangle(x * width, y * height, width, height, TileColor);
}
